<!DOCTYPE html>
<html>
    <head>
        <link rel="icon" href="/static/images/favicon.ico" type="image/x-icon" />
        <link rel="shortcut icon" href="/static/images/favicon.ico" type="image/x-icon" />
        <link href="/static/iconcool/style.css" rel="stylesheet">
        <meta charset="utf-8">
        <title> 蓝盾 | Stream </title>
    </head>
    <body>
        <div id="app"></div>
        <script>
            var SITE_URL = ''
            var STATIC_URL = '/'
            var REMOTE_STATIC_URL = ''
            // 接口请求前缀
            var AJAX_URL_PREFIX = '/'
            // websocket 链接地址
            var WEBSOCKET_URL_PREFIX = ''
            // 记录项目 id 的 cookie key
            var X_DEVOPS_PROJECT_ID = 'X-DEVOPS-PROJECT-ID'
            // 判断是否灰度的 cookie key
            var ROUTER_TAG = 'ROUTER_TAG'
            // 自动登录地址
            var LOGIN_SERVICE_URL = '__STREAM_SERVICE_LOGIN_URL__'
            // 蓝鲸登录地址
            var LOGIN_URL = '__STREAM_LOGIN_URL__'
            // devnet host
            var DEVNET_HOST = '__BKCI_DEVNET_FQDN__'
            // 蓝盾 host
            var DEVOPS_HOST = '__BKCI_FQDN__'
            // 仓库 host
            var BKREPO_HOST = '__BK_REPO_HOST__'
            // app key
            var APP_KEY = '__STREAM_LOGIN_APP_KEY__'
        </script>
        <script>
            function getLoginUrl (domain = LOGIN_SERVICE_URL) {
                const cUrl = location.href
                const loginUrl = new URL(domain)
                const url = new URL(LOGIN_URL)
                url.searchParams.append('bk_appid', 1)
                url.searchParams.append('bk_login', 1)
                url.searchParams.append('c_url', cUrl)
                
                loginUrl.searchParams.append('title', 'bklogin')
                loginUrl.searchParams.append('appkey', APP_KEY)
                loginUrl.searchParams.append('url', url)
                
                return loginUrl.href
            }
        </script>
        <script src="/static/iconcool/iconcool.js"></script>
    </body>
</html>
